package cn.tedu.javagame.Plane;

import java.awt.*;

//定义了一个抽象类，当做父类来使用
public abstract class FlyObject {
    //属性
    int x,y;
    int speed;
     Image img;
     Image[] imgs;
     public FlyObject(){
         this.speed = (int)(Math.random()*5+2);
     }
     public abstract void move();
     int index = 0;
     public void step(){
        index++;
        if(index == Integer.MAX_VALUE)index=-1;
        this.img = this.imgs[index++/10%this.imgs.length];
     }
}
